package com.link.base.base.saleactivity.service;


import com.link.base.base.coupons.model.Coupons;
import com.link.base.base.saleactivity.model.AccntCampMonitor;
import com.link.base.base.saleactivity.model.Odds;
import com.link.base.base.saleactivity.model.SaleActivity;
import com.link.core.basic.query.QueryParams;
import com.link.core.basic.service.BasicService;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * @author: wangdawei
 * @date: 2018/6/1
 * 营销活动-service
 */

public interface SaleActivityService extends BasicService<SaleActivity> {


    /**
     * <p> 门店用户登陆接口/p>
     * @author wangdawei
     * @param entity
     * @return List SaleActivity
     * @throws Exception
     * @date 2018/5/20
     */
    public List<SaleActivity> queryStoreAcntByExamplePage(SaleActivity entity) throws Exception;

    /**
     * <p> 渠道商用户登录/p>
     * @author wangdawei
     * @param entity
     * @return List SaleActivity
     * @throws Exception
     * @date 2018/5/20
     */
    public List<SaleActivity> queryCeStoreAcntByExamplePage(SaleActivity entity) throws Exception;


    /**
     * <p> H5页面大转盘活动/p>
     * @author wangdawei
     * @param act
     * @param qps
     * @param request
     * @return Object
     * @throws Exception
     * @date 2018/5/20
     */
    public Object[] querybigWheelInfoByAtyIdAndAcctId(SaleActivity act, QueryParams qps, HttpServletRequest request) throws Exception;

    /**
     * <p> H5页面大转盘活动单击抽奖按钮/p>
     * @author wangdawei
     * @param odds
     * @param arry
     * @param act
     * @param accntId
     * @return Odds
     * @throws Exception
     * @date 2018/5/20
     */
    public Odds reffle(Odds odds, Object[] arry, SaleActivity act, Long accntId) throws Exception;

    /**
     * <p>保存活动</p>
     * @author
     * @param entity
     * @throws Exception
     * @date 2018/5/20
     */
    public void insertSaleActivity(SaleActivity entity) throws Exception;

    /**
     * <p>查看活动</p>
     * @author wangdawei
     * @param entity
     * @return SaleActivity
     * @throws Exception
     * @date 2018/5/19
     */
    public SaleActivity getSaleActivityById(SaleActivity entity) throws Exception;

    /**
     * <p>编辑活动</p>
     * @author wangdawei
     * @param entity
     * @throws Exception
     * @date 2018/5/17
     */
    public void updateSaleActivity(SaleActivity entity) throws Exception;

    /**
     * 分享领券活动-加载页面
     * @author  wangdawei
     * @param entity
     * @return
     * @throws Exception
     */
    public SaleActivity shareCouponLoading(SaleActivity entity) throws Exception;

    /**
     * 分享领券活动-加载页面
     * @author  wangdawei
     * @param entity
     * @return
     * @throws Exception
     */
    public SaleActivity showCompainDetail(SaleActivity entity) throws Exception;

    /**
     * 分享优惠券
     * @author  wwnagdwei
     * @param entity 优惠券实体类
     * @return
     * @throws Exception
     */
    Map<String,Object> shareCoupons(SaleActivity entity) throws Exception;

    /**
     * 判断用户是否是会员
     * @param saleActivity
     * @return
     * @throws Exception
     */
    Map<String,Object> isMpmeber(SaleActivity saleActivity) throws Exception;

    /**
     * 查询已分享好友列表
     * @param accntCampMonitor
     * @return
     * @throws Exception
     */
    Map<String,Object> accountList(AccntCampMonitor accntCampMonitor) throws Exception;


    /**
     * 导购助手生成二维码图片
     * @param entity
     * @return
     * @throws Exception
     */
    SaleActivity createQrCode(SaleActivity entity) throws Exception;

    /**
     * 导购助手生成二维码图片
     * @param entity
     * @return
     * @throws Exception
     */
    SaleActivity createH5UrlCode(SaleActivity entity) throws Exception;

    /**
     * 查询所有在大屏的活动
     * @author KuangRuifeng
     * @date 2018/12/19
     * @param record 包含loginCorpId的查询信息
     * @return 大屏中展示的活动id数组
     * @throws Exception 异常
     */
    List<String> queryFilterIdList(SaleActivity record) throws Exception;

    /**
     * 查询红包活动并校验
     * @author 路江
     * @param entity
     * @return
     * @throws Exception
     */
    Map<String,Object> queryRedPackActivity(SaleActivity entity) throws Exception;

    /**
     * 红包活动校验：有效期，人数上限，金额上限，个数上限。
     * @author 路江
     * @param entity
     * @param acctId
     * @return
     * @throws Exception
     */
    Coupons checkRedPackData(SaleActivity entity,Long acctId) throws Exception;

    /**
     * 获取红包金额
     * @param entity
     * @return
     * @throws Exception
     */
    Double getRedPackAmount(Coupons entity) throws Exception;
}
